/*
 * 创建日期 2009-11-11
 *
 * 成都天和软件公司
 * 电话：028-85425861
 * 传真：028-85425861-8008
 * 邮编：610041 
 * 版权所有
 */
package  org.fantasy.cpp.core.html.query;

import javax.servlet.http.HttpServletRequest;

import  org.fantasy.cpp.core.bean.ParamContext;
import  org.fantasy.common.util.StringUtil;

/**
 *  简单文本框
 * @author: wzy
 * @version: 1.0
 * @since 2010-4-22
 */
public class TextAreaHtml extends AbstractQueryHtml {

    public TextAreaHtml(HttpServletRequest request, ParamContext param) {
        super(request, param);
    }

    public String getHtml(){
        StringBuffer html = new StringBuffer(1024);
        html.append("<span class='"+ SPAN_CLASS +"'>" + getLabelName() + "</span>");
        html.append("<span class='"+ SPAN_CLASS +"'><textArea " + getIsReadonly(code) + " id='"
                + code + "'" + getClassHtml() + " name='" + code
                + "'"+ getStyleHtml()+">" + defValue);
        html.append("</textArea></span> \n");
        return html.toString();
    }
    
    @Override
    protected String getStyleHtml(){
    	StringBuffer html = new StringBuffer(32);
    	if (StringUtil.isValid(style)){
    		return super.getStyleHtml();
    	}
    	else 
    		html.append(" style=\"height:45px;width:85%;margin-left:2px;margin-right:2px;\"");
    		
    	return html.toString();
    }
}
